UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kbU9GKkVw5Mu+sG3373oZQLc0A0oRkgjkIFvVxlPTaY='
WHERE
key_id = '7e9b1e60b90eec606c302c0817005289dd5ea14d0bf3f28ab7f658f5c22abe52'
AND (
token = 'kbU9GKkVw5Mu+sG3373oZQLc0A0oRkgjkIFvVxlPTaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)