UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f1WMghFxlI7+NlGt7vxRQ87RYdVIWt4ouj1C1OQPtl8='
WHERE
key_id = '96500706fdde5427b169cd4fb62fab471ebe742967973b799312e0fee75dc42e'
AND (
token = 'f1WMghFxlI7+NlGt7vxRQ87RYdVIWt4ouj1C1OQPtl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)