UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G2UJDxIVDZjXs2j3nLE6lQ8US6hUnCxX4AJ2AzvASz8='
WHERE
key_id = 'e080a10e28ad4a9b9e8d207dbdfd28f33e0b6da23b8ed9f1a034ce85f830c5e9'
AND (
token = 'G2UJDxIVDZjXs2j3nLE6lQ8US6hUnCxX4AJ2AzvASz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)