UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vI7Vvc8e+CyDOTgwDlow/ZaY70NgKNiiyzw69W1e0C4='
WHERE
key_id = '76b55024db5abc3ba1c21efcbaa6be6e8278e83363d4d86cec39ac099a4af00f'
AND (
token = 'vI7Vvc8e+CyDOTgwDlow/ZaY70NgKNiiyzw69W1e0C4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)