UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1b+p+kxACCyGrKzUDG3G5zsXHT1rlyxxkJOja9ciZx4='
WHERE
key_id = '8899ea1b72aaab5acd98bcc647dc55bc8e0207891b0e51a55a0af236b1dc3ca6'
AND (
token = '1b+p+kxACCyGrKzUDG3G5zsXHT1rlyxxkJOja9ciZx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)