UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p/4dSWGaKZp0yv7Fsak6T5NDNtux36cLXnS7Y/rdRT8='
WHERE
key_id = 'de9288d360bf88be9d03f317d87e3a82c1d22b7032bad3dc847ffa06fd53ae4c'
AND (
token = 'p/4dSWGaKZp0yv7Fsak6T5NDNtux36cLXnS7Y/rdRT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)