UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cbpOm/Wz1TMBWnbBLDOVqegFiznpbFYcTdSW9e9WoEg='
WHERE
key_id = '7f6170472359ef298bf77b28c8e990baa5ad3780046fad001e420125bc548634'
AND (
token = 'cbpOm/Wz1TMBWnbBLDOVqegFiznpbFYcTdSW9e9WoEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)