UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/KLKVhFdL4fOErctUmYArUsoTsfmQNDSQSHoz8Pp4hY='
WHERE
key_id = '6ff02c95c8b42bee1c6ac4515c0b8bff492b9b9313468b0ad7e679c7055b8431'
AND (
token = '/KLKVhFdL4fOErctUmYArUsoTsfmQNDSQSHoz8Pp4hY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)