UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gZWt2zynsD2lwN+TrVaMoehu1MtYlyqteqCesJmbmqo='
WHERE
key_id = 'f9e12be9ef68140b1578d7669ff8b172fc9dff3ec3103bb2a5c1bec427e43c34'
AND (
token = 'gZWt2zynsD2lwN+TrVaMoehu1MtYlyqteqCesJmbmqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)