UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wuzSB8N9rOzsfkjMpgM0dJIBpSMr3yWPf/3WjQ9ixFg=' 
WHERE 
  key_id = 'fded86ca42877abb524d4dc8ffe64e475ed8f95478b68a5ed400347a66e7572e' 
  AND (
    token = 'wuzSB8N9rOzsfkjMpgM0dJIBpSMr3yWPf/3WjQ9ixFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057