UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Le4EdjUfNw9RF2cwAf1DldqdCyx+opRthoLEe9WOoCA='
WHERE
key_id = '951ec34d4600d7d1545186bdab72c2834bc658c88e5b1b9133af834879aa93c3'
AND (
token = 'Le4EdjUfNw9RF2cwAf1DldqdCyx+opRthoLEe9WOoCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)