UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hc5yJjiVwaKquHxt9Pxt8+a93+wc+87nXnC9oeUijbg='
WHERE
key_id = '5e0ec7f195da32498e3284b77715ca59cc2960ed8c85d30503b47645c4d8126c'
AND (
token = 'hc5yJjiVwaKquHxt9Pxt8+a93+wc+87nXnC9oeUijbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)