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