UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZO2u+Sf7h8j6it8Cw2DDpcYqltgcD7EkLdKEUd9Bslk='
WHERE
key_id = '8637598d231c0a7b1425ea852f7c1647618c3a0c8eb71224839ba80451852382'
AND (
token = 'ZO2u+Sf7h8j6it8Cw2DDpcYqltgcD7EkLdKEUd9Bslk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)