UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Cq1VTq3TYhfOFTvLGdno7jxfy6R31ZeMRHPer+jbjk='
WHERE
key_id = '3f237ffb0ae1238b9869c87d4d93299c20b5414458845a88b14ca57e9c530bbe'
AND (
token = '5Cq1VTq3TYhfOFTvLGdno7jxfy6R31ZeMRHPer+jbjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)