UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3XLjgljGIoglapYDqRw7hOM+9bYWEN0forOnjE96spw='
WHERE
key_id = '92839fcf4882b3a2a0588546d36eeb5b075c8a448fc70610cd188b2e174a15f3'
AND (
token = '3XLjgljGIoglapYDqRw7hOM+9bYWEN0forOnjE96spw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)