UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yhKfgH25YxrtKtG366HE3B0lrMA/njHFGifvD5TD9/8='
WHERE
key_id = 'a72e2d36e269ee8df204961721040caec9e4dd273aee6c2a3b6e04779a909e79'
AND (
token = 'yhKfgH25YxrtKtG366HE3B0lrMA/njHFGifvD5TD9/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)