UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Bw3vjWXeRnwz8uy+3tjVIjvB1Pp692U2JpNym1O8qc='
WHERE
key_id = '28195925511747bdb60787dbc4cc4bf281dedec67ce5c7caa5a95b81ab9d17bd'
AND (
token = '8Bw3vjWXeRnwz8uy+3tjVIjvB1Pp692U2JpNym1O8qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)