UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rvB7xsywXTL8IfZ9vn+Q9mrhw+wmMkE2YcOj8AnKSws='
WHERE
key_id = 'cd4c19266acac6ed2f576e8b147bb96102bec36bc9b70e6dd78a4fff769955af'
AND (
token = 'rvB7xsywXTL8IfZ9vn+Q9mrhw+wmMkE2YcOj8AnKSws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)