UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wXBq9KhWeH5qyqCvxexXtpIUj/5Ryn1LUjTfTovV52Q='
WHERE
key_id = 'ee06655f99b507b57506818dc5bdef3d1cbbd9c8fbc9fe89ed6a305efd01765a'
AND (
token = 'wXBq9KhWeH5qyqCvxexXtpIUj/5Ryn1LUjTfTovV52Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)