UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F0rKrLfO0LQ491foZitH9e78KGA6jAEcuHV9dSp2XDs='
WHERE
key_id = '13642e1a916b4e4192db3ea2d4b22e217dab27335f864712766be1a75d2dca9f'
AND (
token = 'F0rKrLfO0LQ491foZitH9e78KGA6jAEcuHV9dSp2XDs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)