UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAn0dg8guu/vYKujXrLx+hY2EklqAXhYNRFovpiVLnw='
WHERE
key_id = '0c8b1bf791b1a9004d73566bccf9cbf4c2631afe887dd05b6ee2f5ed153821db'
AND (
token = 'yAn0dg8guu/vYKujXrLx+hY2EklqAXhYNRFovpiVLnw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)