UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R7HscJaADmlhUSW92L1Z9s47PmZ2iEFIYi3Y6U5Il7o='
WHERE
key_id = 'e08f05042058f3596f26299c7356fd09312080aa2c4d1a58a46da456ce55fe46'
AND (
token = 'R7HscJaADmlhUSW92L1Z9s47PmZ2iEFIYi3Y6U5Il7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)