UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yKG5/dnWvng4RnnRBtnNjSttrfNmRcIfE6lApHuDgTM='
WHERE
key_id = 'f32859269e239eb91093f074da0cf6a94d4a97ead89695ce9763a726fcdd7bdd'
AND (
token = 'yKG5/dnWvng4RnnRBtnNjSttrfNmRcIfE6lApHuDgTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)