UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KoEN1AQyDN05FcO3b+56BVGj5xIdfW0OGyXGcxGgdLQ='
WHERE
key_id = '4c5cef46cc652354b285c8fb969b143c95e23f81044d1b804c6bff97bbe3b1b7'
AND (
token = 'KoEN1AQyDN05FcO3b+56BVGj5xIdfW0OGyXGcxGgdLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)