UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'njBOsBQdmUgwTyE5ibaQHbhWf8xVBNExROyzQWMnctY='
WHERE
key_id = '0478676da375a97fdc186438472ef8bd70f92d741cf6338ca03459b19aefde53'
AND (
token = 'njBOsBQdmUgwTyE5ibaQHbhWf8xVBNExROyzQWMnctY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)