UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b4pG/kLnE1CmC+wTqG0z/ylJSJe6FYy787KHBQAHaSc='
WHERE
key_id = 'adc6c93b254a228af41de5fb955e2862759216974d9cad24fbe0c2d820a2f802'
AND (
token = 'b4pG/kLnE1CmC+wTqG0z/ylJSJe6FYy787KHBQAHaSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)