UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FErUFSt7UvebAZMSMl1GYuqj8pTf+uODVidGdCEUgbE='
WHERE
key_id = 'e10d22b0741046a53d8cc917bf787b9e9444d602376b9347093d23e772436021'
AND (
token = 'FErUFSt7UvebAZMSMl1GYuqj8pTf+uODVidGdCEUgbE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)