UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ClH4IZG+w0bnedysFZqb2Grre1f9UK3A+F2pOxmUBmg='
WHERE
key_id = '6326186b33ad8462caa180e6105c6821cdf017a4bbebdbb0f44bc3390fe43a70'
AND (
token = 'ClH4IZG+w0bnedysFZqb2Grre1f9UK3A+F2pOxmUBmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)