UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M5x6BhGhUqkNB8jGb2NA0iWdZdFZUkM0sJRrGmhp+/4='
WHERE
key_id = '94749893ee617fae73c4bb70440f0ca381e7e1a077c9f6c02dcd2ecdf530a47b'
AND (
token = 'M5x6BhGhUqkNB8jGb2NA0iWdZdFZUkM0sJRrGmhp+/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)