UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u4EIRJVIWqqB5KoUmCg+xqMUlI4316jScKOWO22QATI='
WHERE
key_id = 'cb7ccd6620922e276028b8aa98d4174709f31bfb2d6bb52978c7dbcdea706da3'
AND (
token = 'u4EIRJVIWqqB5KoUmCg+xqMUlI4316jScKOWO22QATI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)