UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Rl3Ef2Iv+OVs1UJI3Hcgmo5ubk3Q17dksf0pfolC8s='
WHERE
key_id = '0dbe14cb0517f2ee628d7fc3e1388a0262e95541029bc2ef39cf1bb1e4ae4851'
AND (
token = '2Rl3Ef2Iv+OVs1UJI3Hcgmo5ubk3Q17dksf0pfolC8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)