UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MoCt8aOTSIUhSbmgD7CYctV2k8PM4vTObHBVrcqPc5Y='
WHERE
key_id = '7f6b5bc32ab1f61d3f1fa72559b8f8bb2d45b30ee75374159d3ee88e4697e1ab'
AND (
token = 'MoCt8aOTSIUhSbmgD7CYctV2k8PM4vTObHBVrcqPc5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)