UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hvcVf35IVz2uPROca9ZzEwSh0hUu+QEXIBbiNmRdplc='
WHERE
key_id = '266ea81f54dc3e1b6c67306fe8fa993d1a2f6d2a0c8816675e0ce74764798328'
AND (
token = 'hvcVf35IVz2uPROca9ZzEwSh0hUu+QEXIBbiNmRdplc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)