UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7wYTit2EJnBFMKyA+Bda8Wq5M0hqpHsktxBcGdr+HV4='
WHERE
key_id = 'e935056eea496dd5faae02014ef176dc8e976fc82a666a3aaf233cb61dcae9f9'
AND (
token = '7wYTit2EJnBFMKyA+Bda8Wq5M0hqpHsktxBcGdr+HV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)