UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nt1MvowBjOQA6HzGVraZkQ13Das78MHkThhgHi2GLRs='
WHERE
key_id = '29531f6a4bf160d52ea82e2a13ae2d41fa41fe20943eb58290b1b51363149ad2'
AND (
token = 'nt1MvowBjOQA6HzGVraZkQ13Das78MHkThhgHi2GLRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)