UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H9+OxeZyNxhgXnSVhTtg9fV1nVEmAyWWcDM4Bo8AsSU='
WHERE
key_id = 'bc5d1645287854673ffcb8f4c0bc2d2b98b1eb27097c59ffe078674d590e7c66'
AND (
token = 'H9+OxeZyNxhgXnSVhTtg9fV1nVEmAyWWcDM4Bo8AsSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)